define(['egis'], function (egis) {
    Window.deserializer = Window.deserializer || new egis.core.Deserializer();
    Window.container = Window.container || {};
    /*dsBridge.register('create_RestGeoService', function (sourceId, url, http) {
        var restHttp = Window.container[http];
        var restGeoService = new egis.ews.RestGeoService({
            url: url,
            http: restHttp,
            deserializer: Window.deserializer
        });
        Window.container[sourceId] = restGeoService;
    })*/

    dsBridge.registerAsyn('RestGeoService_getCapability', function (sourceId, layer, responseCallback) {
        var restGeoService = Window.container[sourceId];
        restGeoService.getCapability(layer).then(function (value) {
            responseCallback(JSON.stringify(value));
        })
    })

    dsBridge.registerAsyn('RestGeoService_getCapabilities', function (sourceId, responseCallback) {
        var restGeoService = Window.container[sourceId];
        restGeoService.getCapabilities().then(function (value) {
            responseCallback(JSON.stringify(value));
        })
    })

})